<?php

/* @var $this \yii\web\View */
/* @var $content string */
///Url::to('@web/img/backup/ttt.jpg');
use yii\helpers\Url;
use yii\helpers\Html;
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
<HTML xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title><?= Yii::$app->name; ?></title>
    <script type="text/javascript" src="<?=Url::to('@web/js/jquery.js');?>"></script>
</head>
<body>
<strong>数据备份</strong>



<table width="100%" border="1" align="center" cellpadding="8" cellspacing="1" bordercolor="#CFCFCF" style="margin-top:8px;">

      <tr>
            <td colspan="6" >说明:点击备份可将所有的数据表结构和数据完全备份到项目web/backup/目录下(Linux下注意将此目录权限设置为777) </td>
          </tr>
      <tr bgcolor="#f4fbf4" height="22">
            <td height="26" align="center" bgcolor="#FAFAF1" ><span class="STYLE1">备份记录</span></td>
            <td height="26" align="center" bgcolor="#FAFAF1" >文件大小</td>
            <td height="26" align="center" bgcolor="#FAFAF1" >备份日期</td>
            <td height="26" align="center" bgcolor="#FAFAF1" >基本操作</td>
        </tr>
       <?php foreach($data as $val){ ?>
          <tr onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22" >
                 <td width="32%"><?php echo $val['name']; ?></td>
                 <td width="17%" align="center"><?php echo $val['size']; ?></td>
                 <td width="28%" align="center"><?php echo $val['time']; ?></td>
                 <td width="23%" align="center">
                        <?=Html::a("删除",
                             ['/admin/data-back/delete_back', 'file'=>$val['name']],
                            [
                                "title"=>"删除",
                                'onclick'=>"{if(confirm('您真的要删除吗?')){return true;}return false;}"
                             ]) ?> 
                        <?=Html::a("下载",["/admin/data-back/admin/data-back/downloadbak",'file'=>$val['name'],
                                [ "title"=>"点击下载"]
                                ]);?>
                         <?=Html::a('还原',
                            ['/admin/data-back/recover',
                                'file'=>$val['name']
                            ],
                            [
                                "title"=>"还原",
                                'onclick'=>"{if(confirm('确定要还原吗?')){return true;}return false;}"
                            ]
                        );?>
                  </td>
              </tr>
          <?php } ?>
       <tr onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22" >
            <td colspan="4" align="center">
                    <form action="<?=Url::to(["/admin/data-back/backup"])?>" >

                        <input type="submit" value="一键备份"/>
                    </form>
                
              </td>
          </tr>
</table>


</body>
</HTML>

